home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mobiclic 83
/
MOBICLIC 83.ISO
/
mac
/
pour MacOsX
/
QuickTime6_MacOsX
/
QuickTime651.pkg
/
Contents
/
Resources
/
preflight
< prev
Wrap
Text File
|
2004-03-18
|
2KB
|
91 lines
#!/usr/bin/perl
#######################################
my $permissions_info_file = "/tmp/com.apple.installation.savedperm";
my $target_disk = $ARGV[2];
my @stat_info;
my $MODE = 2;
my $UID = 4;
my $GID = 5;
if(! -e $permissions_info_file || (-e $permissions_info_file && unlink($permissions_info_file))) {
@stat_info = stat($target_disk);
if(open(PERMS_FILE_HDL, ">$permissions_info_file")) {
print(PERMS_FILE_HDL join("\n", stat($target_disk)));
close(PERMS_FILE_HDL);
chmod(oct(700), "$permissions_info_file");
}
}
########################################
my $runnerPID = getppid();
my $installerPID = "";
my $uid = "";
my $uname = "";
open( PSOUT, "/bin/ps -axww -o pid,ppid -p $runnerPID |" );
while( <PSOUT> ) {
my @fields = split '\s+', $_;
if ("$fields[1]" eq "$runnerPID") {
$installerPID = $fields[2];
}
}
close( PSOUT );
if ("$installerPID" ne "") {
open( PSOUT, "/bin/ps -axww -o pid,ruid -p $installerPID |" );
while( <PSOUT> ) {
my @fields = split '\s+', $_;
if ("$fields[1]" eq "$installerPID") {
$uid = $fields[2];
}
}
close( PSOUT );
}
if ("$uid" ne "") {
open( PSOUTA, "/usr/bin/id -p $uid |" );
while( <PSOUTA> ) {
my @fields = split '\s+', $_;
if ("$fields[0]" eq "uid") {
$uname = $fields[1];
}
}
close( PSOUTA );
}
# Marketing (aka Amy Fazio) sez we don't need to bring up the registration dialog anymore
# but let's just comment it out for now in case they change their minds. - duano! 3/16/04
# ... see, QT BRB did change their minds on this. Putting it back until Gibson - duano! 3/17/04
if ("$ENV{COMMAND_LINE_INSTALL}" ne "1") {
my $ALERT_APP = "$ARGV[0]" . "/Contents/Resources/QT6Installer.app/Contents/MacOS/QT6Installer";
my $EXIT_VALUE = 0;
my $cmd = "\"$ALERT_APP\" -showregistration";
if ("$uname" ne "") {
$cmd = "sudo -u $uname \"$ALERT_APP\" -showregistration";
}
$EXIT_VALUE = system("$cmd");
if (($EXIT_VALUE >> 8) != 0) {
if ("$installerPID" ne "") {
kill "QUIT", $installerPID;
}
kill "QUIT", $runnerPID;
exit($EXIT_VALUE >> 8);
}
}
my $CLEANUP_PREFS = "$ARGV[0]" . "/Contents/Resources/CleanPrefs";
my $cmd = "\"$CLEANUP_PREFS\"";
if ("$uname" ne "") {
$cmd = "sudo -u $uname \"$CLEANUP_PREFS\"";
}
system("$cmd");